VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsARVBO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit

Public Function IIf(Expression, TruePart, FalsePart)
    IIf = VBA.IIf(Expression, TruePart, FalsePart)
End Function

Public Function Format(Expression, sFormat)
    Format = VBA.Format(Expression, sFormat)
End Function

' purpose: converts given ADO recordset to array suitable for MSChart.Chartdata property
' use optional flds parameter to specify fields (by names) for appropriate chart series
Public Function getChartDataFromRecordset(rsData) As Variant
Dim rs As ADODB.Recordset

    Dim vPlain As Variant
    
    Set rs = rsData
    
    rs.MoveFirst
    
    vPlain = rs.GetRows
    
    Dim i1 As Long, i2 As Long, j1 As Long, j2 As Long
    i1 = LBound(vPlain, 1): i2 = UBound(vPlain, 1)
    j1 = LBound(vPlain, 2): j2 = UBound(vPlain, 2)
    
    Dim vr As Variant
    ReDim vr(0 To j2 - j1, 0 To i2 - i1)
            
    Dim i As Long, j As Long
    For i = i1 To i2
        For j = j1 To j2
            vr(j - j1, i - i1) = vPlain(i, j)
        Next
    Next
    
    getChartDataFromRecordset = vr
End Function

